use std::io::Cursor;

fn main() {
    let password = rpassword::read_password().unwrap();
    println!("Your password is {}", password);

    let password = rpassword::prompt_password("Your password: ").unwrap();
    println!("Your password is {}", password);

    let mut mock_input = Cursor::new("my-password\n".as_bytes().to_owned());
    let password = rpassword::read_password_from_bufread(&mut mock_input).unwrap();
    println!("Your password is {}", password);

    let mut mock_input = Cursor::new("my-password\n".as_bytes().to_owned());
    let mut mock_output = Cursor::new(Vec::new());
    let password = rpassword::prompt_password_from_bufread(
        &mut mock_input,
        &mut mock_output,
        "Your password: ",
    )
    .unwrap();
    println!("Your password is {}", password);
}
